package lesson2.com.animals;

public class Lion extends Feline{
    
    private String name="unnamed";
    
    public Lion(String name){
        this.name=name;
        
    }
    
    public String getName(){
        return name;
    }
    
    public boolean equals(Object obj){
        
        if(!(obj instanceof Lion)){
            return false;
        }
        
        Lion theOtherLion = (Lion)obj;
        String theOtherLionsName = theOtherLion.getName();
        String thisLionsName = this.name;
        
        if(thisLionsName.equals(theOtherLionsName)){
            return true;
        }else {
            return false;
        }
        
        // most likely written as follows
        // return thisLionsName.equals(theOtherLionsName);
    }
    
    @Override
    public void walk(){
        System.out.println(name+ "is walking... but  I prefer to ...STALK!!");
    }
    
    public void roar(){
        System.out.println("Get outta my way I'm hungry");
    }

}
